import { createRouter, createWebHistory } from 'vue-router'
import HomePage from '../pages/HomePage.vue'
import PostDetailPage from '../pages/PostDetailPage.vue'
import CategoriesPage from '../pages/CategoriesPage.vue'
import TagsPage from '../pages/TagsPage.vue'
import AboutPage from '../pages/AboutPage.vue'
import AllPostsPage from '../pages/AllPostsPage.vue'
import FeaturedPostsPage from '../pages/FeaturedPostsPage.vue'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: HomePage
  },
  {
    path: '/post/:id',
    name: 'PostDetail',
    component: PostDetailPage,
    props: true
  },
  {
    path: '/categories',
    name: 'Categories',
    component: CategoriesPage
  },
  {
    path: '/tags',
    name: 'Tags',
    component: TagsPage
  },
  {
    path: '/about',
    name: 'About',
    component: AboutPage
  },
  {
    path: '/posts',
    name: 'AllPosts',
    component: AllPostsPage
  },
  {
    path: '/featured',
    name: 'FeaturedPosts',
    component: FeaturedPostsPage
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
